- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 33.3k
          gh-118965: Share NotImplemented in subinterpreters
          #118966
        
          New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| cpython/Lib/test/test_interpreters/test_api.py Lines 1128 to 1130 in 176b42a 
 Should be moved to cpython/Lib/test/test_interpreters/test_api.py Lines 1099 to 1101 in 176b42a 
 By the way, is there a reason  | 
| @nineteendo thanks. 
 I don't think so. I plan to address it in the next PR. | 
| FWIW, there's no urgency here.  The other singletons have a clear value in being shareable.  However,  | 
| // NotImplemented | ||
| if (_xidregistry_add_type(xidregistry, | ||
| (PyTypeObject *)PyObject_Type(Py_NotImplemented), | ||
| _notimplemented_shared) != 0) { | ||
| Py_FatalError("could not register NotImplemented for cross-interpreter sharing"); | ||
| } | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we generalize this with a macro? (Future refactoring)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. Last I heard, Eric's plan was to eventually get a dedicated type slot for crossinterpreter registry things, so this will (hopefully) be obsolete sooner than later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to work through the subinterpreter backlog a bit :)
| // NotImplemented | ||
| if (_xidregistry_add_type(xidregistry, | ||
| (PyTypeObject *)PyObject_Type(Py_NotImplemented), | ||
| _notimplemented_shared) != 0) { | ||
| Py_FatalError("could not register NotImplemented for cross-interpreter sharing"); | ||
| } | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. Last I heard, Eric's plan was to eventually get a dedicated type slot for crossinterpreter registry things, so this will (hopefully) be obsolete sooner than later.
        
          
                Misc/NEWS.d/next/Core and Builtins/2024-05-12-15-19-40.gh-issue-118965.Lr3qAz.rst
              
                Outdated
          
            Show resolved
            Hide resolved
        
      Co-authored-by: Peter Bierma <[email protected]>
| Merging from main seemed to blow up CI. I think something changed with XI registries after this was created. | 
I still use
Py_NewRefdespite the fact thatNotImplementedis immortal:NotImplementedsingletons in subinterpreters #118965